#ifndef HARDWARE_H
#define HARDWARE_H


//*************************************
//*			J1 [Channel 1]
//*************************************
#define CH1_POWER_CTRL_PORT		GPIOA
#define CH1_POWER_CTRL_PIN		GPIO_Pin_6

#define CH1_PULLUP_CTRL_PORT	GPIOB
#define CH1_PULLUP_CTRL_PIN		GPIO_Pin_2

#define CH1_IOA_PORT			GPIOB
#define CH1_IOA_PIN				GPIO_Pin_0

#define CH1_IOB_PORT			GPIOB
#define CH1_IOB_PIN				GPIO_Pin_1

#define CH1_IOA_ADC_CH			ADC_Channel_8		
#define CH1_IOB_ADC_CH			ADC_Channel_9

#define CH1_IOB_EXTI_LINE		EXTI_Line1

#define CH1_IOB_TIMER_BASE		TIM3
#define CH1_IOB_TIMER_CH		TIM_Channel_4


//*************************************
//*			J2 [Channel 2]
//*************************************
#define CH2_POWER_CTRL_PORT		GPIOA
#define CH2_POWER_CTRL_PIN		GPIO_Pin_5

#define CH2_PULLUP_CTRL_PORT	GPIOA
#define CH2_PULLUP_CTRL_PIN		GPIO_Pin_4

#define CH2_IOA_PORT			GPIOA
#define CH2_IOA_PIN				GPIO_Pin_3

#define CH2_IOB_PORT			GPIOA
#define CH2_IOB_PIN				GPIO_Pin_2

#define CH2_IOA_ADC_CH			ADC_Channel_3		
#define CH2_IOB_ADC_CH			ADC_Channel_2

#define CH2_IOB_EXTI_LINE		EXTI_Line2

#define CH2_IOB_TIMER_BASE		TIM2
#define CH2_IOB_TIMER_CH		TIM_Channel_3


//*************************************
//*			J3 [Channel 3]
//*************************************
#define CH3_POWER_CTRL_PORT		GPIOA
#define CH3_POWER_CTRL_PIN		GPIO_Pin_8

#define CH3_PULLUP_CTRL_PORT	GPIOC
#define CH3_PULLUP_CTRL_PIN		GPIO_Pin_13

#define CH3_IOA_PORT			GPIOA
#define CH3_IOA_PIN				GPIO_Pin_1

#define CH3_IOB_PORT			GPIOA
#define CH3_IOB_PIN				GPIO_Pin_0

#define CH3_IOA_ADC_CH			ADC_Channel_1		
#define CH3_IOB_ADC_CH			ADC_Channel_0

#define CH3_IOB_EXTI_LINE		EXTI_Line0

#define CH3_IOB_TIMER_BASE		TIM2
#define CH3_IOB_TIMER_CH		TIM_Channel_1


//*************************************
//*			Bluetooth and USART
//*************************************
#define USART1_PORT				GPIOA
#define USART1_RXD_PIN			GPIO_Pin_10
#define USART1_TXD_PIN			GPIO_Pin_9

#define USART3_PORT				GPIOB
#define USART3_RXD_PIN			GPIO_Pin_11
#define USART3_TXD_PIN			GPIO_Pin_10

#define BLUETOOTH_USART			USART1
#define BLUETOOTH_CTRL_PORT		GPIOB
#define BLUETOOTH_RESET_PIN		GPIO_Pin_12
#define BLUETOOTH_MODE_PIN		GPIO_Pin_13


//*************************************
//*			MMA8451
//*************************************
#define GRAVITY_I2C_BASE		I2C1
#define GRAVITY_I2C_PORT		GPIOB
#define GRAVITY_I2C_SDA_PIN		GPIO_Pin_7
#define GRAVITY_I2C_SCL_PIN		GPIO_Pin_6

#define GRAVITY_INT_PORT		GPIOB
#define GRAVITY_INT_PIN			GPIO_Pin_14

#define GRAVITY_EXTI_LINE		EXTI_Line14


//*************************************
//*			TPS61027 
//*************************************
#define POWER_5V_CTRL_PORT		GPIOB
#define POWER_5V_CTRL_PIN		GPIO_Pin_5S


//*************************************
//*			USB 
//*************************************
#define USB_DMDP_PORT			GPIOA
#define USB_DM_PIN				GPIO_Pin_11
#define USB_DP_PIN				GPIO_Pin_12

#define USB_PULLUP_PORT			GPIOB
#define USB_PULLUP_PIN			GPIO_Pin_9


//*************************************
//*			KEYPAD
//*************************************
#define KEYPAD_PORT				GPIOB
#define KEYPAD_PIN				GPIO_Pin_8
#define KEYPAD_EXTI_LINE		EXTI_Line8

//*************************************
//*			BATTERY MONITOR
//*************************************
#define BATTERY_MONITOR_PORT	GPIOA
#define BATTERY_MONITOR_PIN		GPIO_Pin_7
#define BATTERY_MONITOR_ADC_CH	ADC_Channel_7

#endif /* ifndef HARDWARE_H */
